package com.examstack.portal.persistence;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.examstack.common.domain.exam.UserQuestionCollect;
import com.examstack.common.domain.exam.UserQuestionHistory;
import com.examstack.common.domain.practice.Collect;
import com.examstack.common.domain.question.QuestionStatistic;


public interface QuestionCollectMapper {

	/**
	 * 插入试题 收藏
	 */
	public void insertCollect(@Param("userId")  int userId, @Param("questionId") int questionId, @Param("questionTypeId") int questionTypeId);
	
	/**
	 * 插入试题 收藏
	 */
	public void addUserQuestionCollect(@Param("array") List<UserQuestionCollect> historyList);
	
	/**
	 * 查询收藏
	 */
	public Collect getCollect(@Param("userId")  int userId, @Param("questionId") int questionId);
	
	
	/**
	 * 更新收藏
	 */
	public void updCollect(@Param("userId")  int userId, @Param("questionId") int questionId, @Param("isCollect") String isCollect);
	
	
	/**
	 * 获取用户的试题收藏
	 * @param userId
	 * @param fieldId
	 * @return
	 */
	public List<Collect> getUserQuestionHist(@Param("userId") int userId,@Param("fieldId") int fieldId);
	
	/**
	 * 获取用户的试题练习历史
	 * @param userId
	 * @param fieldId
	 * @return
	 */
	
	
	public List<UserQuestionCollect> getUserQuestionCollect(@Param("userId") int userId,@Param("fieldId") int fieldId);
	
	/**
	 * 根据fieldId,pointId分组统计练习收藏试题数量
	 * @param fieldId
	 * @param userId
	 * @return   getQuestionCollectStaticByFieldId
	 * getQuestionHistStaticByFieldId
	 */
	public List<QuestionStatistic> getQuestionCollectStaticByFieldId(@Param("fieldId") int fieldId,@Param("userId") int userId);
	
	/**
	 * 根据fieldId,pointId,typeId分组统计练习收藏试题数量
	 * @param fieldId
	 * @param userId
	 * @return
	 */
	public List<QuestionStatistic> getTypeQuestionCollecttStaticByFieldId(@Param("fieldId") int fieldId,@Param("userId") int userId);
	
}
